<template>
  <div class="show-module">
    <slot></slot>
    <div class="show-module-hd drag-tongs">{{ title }}</div>
    <div class="show-module-centent">
      <div v-html="compiledMarkdown"></div>
    </div>
  </div>
</template>

<script lang="ts">
  import markdownIt from '@/plugins/markdown/markdown-it.js';

  export default {
    props: {
      type: {
        type: String,
      },

      title: {
        type: String,
      },

      subtitle: {
        type: String,
      },

      describe: {
        type: String,
      },

      // 图表显示数据
      data: {
        type: Object,
        default() {
          return {};
        },
      },
    },
    data() {
      return {};
    },
    computed: {
      compiledMarkdown() {
        return new markdownIt('commonmark').render(this.data.value);
      },
    },
  };
</script>
